<%@ page import="java.util.*"%>
<%@ page import="java.text.*"%>
<%@page import="cn.com.dhcc.app.core.CoreEnv.CoreInitCtx"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/view/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
.max {
  color: red
}

.min {
  color: #bac9d2
}
</style>
<meta charset="utf-8" />
<title>${appname}</title>
<%@ include file="/WEB-INF/view/common/css_js_ace.jsp"%>
<script type="text/javascript">
	var radioValue = '${param.dateScope}';
	var dateValue = '${param.statDate}';
	
	$(document).ready(function() {
		restoreContent();
		findMaxMin();
	});
	
	function restoreContent() {
		if(radioValue != '') {
			$("[name=dateScope]").val([radioValue]);
		}
		
		changeDateFomat();
		
		if(dateValue != '') {
			$('#Date').val(dateValue);
		}
	}
	
	function search(form) {
		$(form).appendPagerParaStr();
		return true;
	}

	function changeDateFomat() {

		var type = $("input[name='dateScope']:checked").val();
		var date;

		if (type == '0') {
			date = $('#hidden_day').val();
			$('#Date')
					.attr("onfocus",
							"WdatePicker({onpicked:function(){},c:'yyyy-MM-dd',maxDate:'%y-%M-{%d-1}'})");
		} else if (type == '1') {
			date = $('#hidden_month').val();
			$('#Date')
					.attr("onfocus",
							"WdatePicker({onpicked:function(){},dateFmt:'yyyy-MM',maxDate:'%y-%M-{%d-1}'})");
		} else {
			date = $('#hidden_year').val();
			$('#Date')
					.attr("onfocus",
							"WdatePicker({onpicked:function(){},dateFmt:'yyyy',maxDate:'%y-%M-{%d-1}'})");
		}

		$('#Date').val(date);
	}
	
	function findMaxMin() {
		var values1 = $('table td.value1').map(function(index, td) {
		    return $(td).text();
		}).get();
		
		var values2 = $('table td.value2').map(function(index, td) {
		    return $(td).text();
		}).get();
		
		var max1 = Math.max.apply(null, values1);
	    var min1 = Math.min.apply(null, values1);
		$('table td.value1').each(function(i, td) {
			$(td).toggleClass('max', +$(td).text() === max1);
		    $(td).toggleClass('min', +$(td).text() === 0);
		});
		
		var max2 = Math.max.apply(null, values2);
	    var min2 = Math.min.apply(null, values2);
	    $('table td.value2').each(function(i, td) {
			$(td).toggleClass('max', +$(td).text() === max2);
		    $(td).toggleClass('min', +$(td).text() === 0);
		});
	}

</script>

</head>

<body>
	<div class="main-container" id="main-container">
		<div class="main-container-inner">
			<div class="main-content" style="margin-left: 0px;">
				<div class="breadcrumbs" id="breadcrumbs">
					<ul class="breadcrumb">
						<li><i class="icon-home home-icon"></i> 首页
						</li>
						<li class="active">综合统计</li>
						<li class="active">任务同步情况统计</li>
					</ul>
				</div>
				
				<div class="page-content">
					
					<div class="tabbable">
					
					
								<ul class="nav nav-tabs" id="myTab">
									<li >
								<a   href="${ctx}/stat/task_syn_stat.do">
									任务同步频次统计
								</a>
									</li>

									<li class="active">
								<a  href="#">
									表格查看
								</a>
									</li>

								</ul>
								
								
								<div class="tab-content">
									<div class="row">
										<div class="col-xs-12">
				
											<div class="widget-box ">
														<form id="searchForm" class="form-search" action="${ctx}/stat/taskSyncStat_info_list.do" method="post" onsubmit="return search(this)">
											<div class="widget-header widget-header-flat">
												<h5 class="smaller lighter">
													<i class="icon-list"></i> &nbsp;
												</h5>
												<div class="widget-toolbar no-border" >
															<button class="btn btn-xs btn-primary" >
																统计</button>&nbsp;&nbsp;&nbsp;
															
												</div>
												<div class="widget-toolbar no-border">
														
														<div class="widget-toolbar no-border">
														<%
															Calendar cal = Calendar.getInstance();
															cal.add(Calendar.DATE, -1);
															String date = new SimpleDateFormat("yyyy-MM-dd").format(cal
																	.getTime());
															String month = new SimpleDateFormat("yyyy-MM")
																	.format(cal.getTime());
															String year = new SimpleDateFormat("yyyy").format(cal.getTime());
														%>
				
														<input type="hidden" name="day" id="hidden_day"
															value="<%=date%>"> <input type="hidden" name="month"
															id="hidden_month" value="<%=month%>"> <input
															type="hidden" name="year" id="hidden_year" value="<%=year%>">
				
				
				
														<span class="input-icon input-icon-right width-100"> <input
															type="text" class="form-control form-input" id="Date"
															name="statDate" value="<%=date%> "
															onfocus="WdatePicker({onpicked:function(){},dateFmt:'yyyy-MM-dd',maxDate:'%y-%M-{%d-1}'});" />
															<i class="icon-calendar blue pointer"
															onclick="javascript:$('#Date').focus();"></i> </span>
													</div>
													<div class="widget-toolbar no-border">
														<span>选择时间 :</span>											
													</div>
													<div class="widget-toolbar no-border">
														<label> <input name="dateScope" type="radio"
															value="0" id="date" checked="checked"
															onclick="changeDateFomat();" /> <span>日</span> </label>
													</div>
													<div class="widget-toolbar no-border">
														<label> <input name="dateScope" type="radio"
															value="1" id="month" onclick="changeDateFomat();" /> <span>月</span>
														</label>
													</div>
													<div class="widget-toolbar no-border">
														<label> <input name="dateScope" type="radio"
															value="2" id="year" onclick="changeDateFomat();" /> <span>年</span>
														</label>
													</div>
													<div class="widget-toolbar no-border">
														<span>选择周期 &nbsp;:</span>				
													</div>
												</div>
																													
												</div>
												</form>
											</div>
											
											<div class="hr hr12 hr-dotted"></div>
											
											
											<div class="table-responsive">
											<table id="sample-table-1" class="table table-striped table-bordered table-hover">
												<thead>
													<tr>
														<th class="center">序号</th>
														<th class="center">任务名称</th>
														<th class="center">数据分类</th>
														<th class="center">同步频次(次)</th>
														<th class="center">数据量(条)</th>
														<th class="center">统计时间</th>	
														<!-- <th class="center">更新时间</th> -->																			
															
													</tr>
												</thead>
				
												<tbody>
													<c:forEach var="vo" items="${_data}" varStatus="varStatus">
													<tr>
														
														<td align="center">${varStatus.index + 1}</td>
														<td align="center">${vo.taskName}</td>
														<td align="center">${vo.dataCataName}&nbsp;</td>
														<td align="center" class="value1">${vo.total}</td>
														<td align="center" class="value2">${vo.dataSize}</td>
														<td align="center"><fmt:formatDate value="${vo.statDate}" pattern="yyyy-MM-dd HH:mm:ss" />&nbsp;</td>										
													   						
													</tr>
													</c:forEach> 
												</tbody>
											</table>
											<jsp:include page="/WEB-INF/view/common/pg.jsp">
												<jsp:param value="${ctx}/stat/taskSyncStat_info_list.do" name="url"/>
												<jsp:param value="${_total}" name="total"/>
												<jsp:param value="${_urlpara}" name="urlpara" />
											</jsp:include>
										</div>
					
											
											
											
											
											
											
											
												
											</div>
										</div>
									</div>
							
							
						
                     </div>


				
					
				</div>
			</div>
		</div>
	</div>
	<%-- <div class="main-container" id="main-container">
		<div class="main-container-inner">
			<div class="main-content" style="margin-left: 0px;">
				<div class="breadcrumbs" id="breadcrumbs">
					<ul class="breadcrumb">
						<li><i class="icon-home home-icon"></i> 首页
						</li>
						<li class="active">综合统计</li>
						<li class="active">任务同步情况统计</li>
					</ul>
				</div>
				
				<div class="page-content">
					<div class="row">
						<div class="col-xs-12">
						
						<div class="tabbable">
								<ul class="nav nav-tabs" id="myTab">
									<li>
								<a   href="${ctx}/stat/task_syn_stat.do">
									任务同步频次统计
								</a>
									</li>

									<li class="active">
								<a  href="${ctx}/stat/taskSyncStat_info_list.do">
									表格查看
								</a>
									</li>

								</ul>
                        </div>

							   <div class="widget-box transparent">
				
				                <div class="widget-toolbar no-border">
									<a class="btn btn-primary btn-xs" href="${ctx}/stat/task_syn_stat.do" ><i class=" icon-on-left"></i>任务同步频次统计&nbsp;&nbsp;</a>
									<a class="btn btn-primary btn-xs" href="${ctx}/stat/taskSyncStat_info_list.do" ><i class=" icon-on-left"></i>表格查看&nbsp;&nbsp;</a>
									<a href="#" data-action="collapse"></a>
	
								</div>
								
								</div>
								</div>

				<div class="page-content">
					<div class="row">
						<div class="col-xs-12">

							<div class="widget-box transparent">
								
				<div class="row">
					<div class="col-xs-12">
						
						<div class="widget-box">
						<form id="searchForm" class="form-search" action="${ctx}/stat/taskSyncStat_info_list.do" method="post" onsubmit="return search(this)">
							<div class="widget-header widget-header-flat">
								<h5 class="smaller lighter">
									<i class="icon-list"></i> &nbsp;
								</h5>
								<div class="widget-toolbar no-border" >
											<button class="btn btn-xs btn-primary" >
												统计</button>&nbsp;&nbsp;&nbsp;
											
								</div>
								<div class="widget-toolbar no-border">
										
										<div class="widget-toolbar no-border">
										<%
											Calendar cal = Calendar.getInstance();
											cal.add(Calendar.DATE, -1);
											String date = new SimpleDateFormat("yyyy-MM-dd").format(cal
													.getTime());
											String month = new SimpleDateFormat("yyyy-MM")
													.format(cal.getTime());
											String year = new SimpleDateFormat("yyyy").format(cal.getTime());
										%>

										<input type="hidden" name="day" id="hidden_day"
											value="<%=date%>"> <input type="hidden" name="month"
											id="hidden_month" value="<%=month%>"> <input
											type="hidden" name="year" id="hidden_year" value="<%=year%>">



										<span class="input-icon input-icon-right width-100"> <input
											type="text" class="form-control form-input" id="Date"
											name="statDate" value="<%=date%> "
											onfocus="WdatePicker({onpicked:function(){},dateFmt:'yyyy-MM-dd',maxDate:'%y-%M-{%d-1}'});" />
											<i class="icon-calendar blue pointer"
											onclick="javascript:$('#Date').focus();"></i> </span>
									</div>
									<div class="widget-toolbar no-border">
										<span>选择时间 :</span>											
									</div>
									<div class="widget-toolbar no-border">
										<label> <input name="dateScope" type="radio"
											value="0" id="date" checked="checked"
											onclick="changeDateFomat();" /> <span>日</span> </label>
									</div>
									<div class="widget-toolbar no-border">
										<label> <input name="dateScope" type="radio"
											value="1" id="month" onclick="changeDateFomat();" /> <span>月</span>
										</label>
									</div>
									<div class="widget-toolbar no-border">
										<label> <input name="dateScope" type="radio"
											value="2" id="year" onclick="changeDateFomat();" /> <span>年</span>
										</label>
									</div>
									<div class="widget-toolbar no-border">
										<span>选择周期 &nbsp;:</span>				
									</div>
								</div>
																									
								</div>
								</form>
							</div>
						
						<div class="hr hr12 hr-dotted"></div>
						
						<div class="table-responsive">
							<table id="sample-table-1" class="table table-striped table-bordered table-hover">
								<thead>
									<tr>
										<th class="center">序号</th>
										<th class="center">任务名称</th>
										<th class="center">数据分类</th>
										<th class="center">同步频次(次)</th>
										<th class="center">数据量(mb)</th>
										<th class="center">统计时间</th>	
										<!-- <th class="center">更新时间</th> -->																			
											
									</tr>
								</thead>

								<tbody>
									<c:forEach var="vo" items="${_data}" varStatus="varStatus">
									<tr>
										
										<td align="center">${varStatus.index + 1}</td>
										<td align="center">${vo.taskName}</td>
										<td align="center">${vo.datacatagoryName}&nbsp;</td>
										<td align="center">${vo.total}</td>
										<td align="center">${vo.dataSize}</td>
										<td align="center"><fmt:formatDate value="${vo.statDate}" pattern="yyyy-MM-dd HH:mm:ss" />&nbsp;</td>
										<td align="center"><fmt:formatDate value="${vo.mtime}" pattern="yyyy-MM-dd HH:mm:ss" />&nbsp;</td>
										
									   						
									</tr>
									</c:forEach> 
								</tbody>
							</table>
							<jsp:include page="/WEB-INF/view/common/pg.jsp">
								<jsp:param value="${ctx}/stat/taskSyncStat_info_list.do" name="url"/>
								<jsp:param value="${_total}" name="total"/>
								<jsp:param value="${_urlpara}" name="urlpara" />
							</jsp:include>
						</div>
					</div>
				</div>
			</div>

									
								</div>
								
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div> --%>
</body>
</html>
